home *** CD-ROM | disk | FTP | other *** search
- Path: due.unit.no!usenet
- From: Vidar Moe <vidarm@ibt.unit.no>
- Newsgroups: comp.lang.c++
- Subject: Solaris -> Windows & byte swapping
- Date: 14 Feb 1996 12:21:33 GMT
- Organization: SINTEF Unimed
- Message-ID: <4fsk4d$lab@due.unit.no>
- NNTP-Posting-Host: unipc50.unimed.sintef.no
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
-
- I have transferred some binary datafiles from Solaris to my PC
- using ftp with the binary file transfer.
-
- My problem is that when I try to parse the datafiles under
- Windows (VC40) using the same C code as on Solaris, it simply
- doesn't work.
-
- I suspect that the parsing failes due to some byteswapping,
- difference in HiByte/LoByte or something like that. I read the
- file using fread to get the binary (image) data into a buffer
-
- fread(buffer, sizeof(unsigned char), dim, mImageFile);
-
- and then I process the bytes in the buffer further (my task is
- to convert a 12 bit image into an 8 bit image, and my problem
- is basically that the 12 bits belonging to each pixel is
- organized differently in the buffer under Windows than under
- Solaris!)
-
- Can somebody help me with this, or give some hints about what
- I might be doing wrong?
-
-
-
- Vidar Moe
- Organization: SINTEF Unimed
-
-